Home | | Latest | About | Random
# Law of cosine.
The law of cosine states the following:
Given any triangle with sides $A,B,C$ and angle $\theta$ opposing side $C$, then we have $$
A^{2}+B^{2}=C^{2} + 2AB\cos\theta
$$
This is a generalization of Pythagorean theorem. Indeed, when the angle $\theta$ opposing side $C$ is $90^{\circ}$, then we get $\cos 90^{\circ}=0$ and we recover Pythagorean theorem, $A^{2}+B^{2}=C^{2}$.
![[summer program 2023/puzzles-and-problems/---files/law-of-cosine 2023-08-16 11.47.10.excalidraw.svg]]
%%[[summer program 2023/puzzles-and-problems/---files/law-of-cosine 2023-08-16 11.47.10.excalidraw.md|🖋 Edit in Excalidraw]], and the [[summer program 2023/puzzles-and-problems/---files/law-of-cosine 2023-08-16 11.47.10.excalidraw.dark.svg|dark exported image]]%%
To prove it, we drop an **altitude** from the vertex where $B$ and $C$ meet down to the side $A$. This altitude is perpendicular to side $A$, and say it has length $R$.
![[summer program 2023/puzzles-and-problems/---files/law-of-cosine 2023-08-16 11.50.46.excalidraw.svg]]
%%[[summer program 2023/puzzles-and-problems/---files/law-of-cosine 2023-08-16 11.50.46.excalidraw.md|🖋 Edit in Excalidraw]], and the [[summer program 2023/puzzles-and-problems/---files/law-of-cosine 2023-08-16 11.50.46.excalidraw.dark.svg|dark exported image]]%%
This altitude cuts side $A$ into two pieces, call them $A_{1}$ and $A_{2}$ as labeled above.
We now know the following:
(1) $A=A_{1}+A_{2}$
(2) $A_{2}=B\cos\theta$ (by trigonometry definition of cosine)
(3) $A_{1}^{2}+R^{2}=C^{2}$ (by Pythagorean)
(4) $A_{2}^{2}+R^{2}=B^{2}$ (by Pythagorean)
From equations (3) and (4) we can eliminate $R^{2}$, by first solving $R^{2}$ from equation (3), say, to get $R^{2} = C^{2}-A_{1}^{2}$. Then plug this into (4), to get $$
A_{2}^{2} + C^{2}-A_{1}^{2}=B^{2}
$$
Now, $A_{1}=A-A_{2}$, so using this into above we can express all in terms of $A, A_{2}, B, C$: $$
A_{2}^{2}+C^{2}-(A-A_{2})^{2}=B^{2}
$$
Finally, we know from (2) $A_{2}=B\cos\theta$. Substituting this into above and simplifying gives the law of cosine.
Do it!